/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qdu.service.impl;

import com.qdu.dao.AdminDao;
import com.qdu.dao.UserDao;
import com.qdu.dao.impl.AdminDaoImpl;
import com.qdu.dao.impl.UserDaoImpl;
import com.qdu.entity.Admin;
import com.qdu.entity.User;
import com.qdu.service.UserService;

/**
 *
 * @author Sanshi
 */
public class UserServiceImpl implements UserService {

    private UserDao ud = new UserDaoImpl();
    private AdminDao Ad = new AdminDaoImpl();

    @Override
    public User login(User user) {
        return ud.getUserByUserNameAndPassWord(user);
    }

    @Override
    public Admin login(Admin admin) {
        return Ad.getAdminByUserNameAndPassWord(admin);
    }
   @Override
    public User getResetCode(User user) {
        return ud.getRestCode(user);
    }
    @Override
    public boolean regist(User user) {
        return (ud.registUser(user));

    }

    @Override
    public boolean fixInfo(User user) {
       return (ud.fixInfo(user));
    }

    @Override
    public boolean resetPwd(User user) {
       return (ud.resetPwd(user));
    }

 

}
